import QtQuick 2.15
import QtQuick.Controls 2.2
import QtQuick.Window 2.15

Window {
    width: 800
    height: 800
    visible: true
    visibility: "Maximized"
    title: qsTr("Image Browser")

    Flickable {
        id: flick

        anchors.fill: parent
        contentHeight: flow.height

        MouseArea {
            anchors.fill: parent
            onWheel: {
                if (wheel.angleDelta.y < 0) {
                    if (flick.atYEnd) {
                        myModel.nextPage();
                    }
                } else {
                    if (flick.atYBeginning)
                        myModel.previousPage();

                }
                wheel.accepted = false;
            }
        }

        Image {
            anchors.fill: parent
            source: myModel.getPicture()
            fillMode: Image.PreserveAspectFit
        }

    }

}
